package com.bolt.report.engine.fill;

import com.bolt.report.definition.StyleDefinition;
import com.bolt.report.engine.BRGroupCalculator;
import com.bolt.report.engine.model.Expression;

public class FillGroupCalculator implements BRGroupCalculator {

    private String fieldName;

    private int index;

    private Expression expression;

    private StyleDefinition style;

    public FillGroupCalculator(String fieldName, int index, String expression) {
        this(fieldName, index, new Expression(expression));
    }


    public FillGroupCalculator(String fieldName, int index, Expression expression) {
        this.fieldName = fieldName;

        this.index = index;
        this.expression = expression;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public void setExpression(Expression expression) {
        this.expression = expression;
    }



    @Override
    public int getFieldIndex() {
        return this.index;
    }

    @Override
    public Expression getExpression() {
        return this.expression;
    }

    @Override
    public String getFieldName() {
        return this.fieldName;
    }

    @Override
    public StyleDefinition getStyle() {
        return this.style;
    }

    public void setStyle(StyleDefinition style) {
        this.style = style;
    }
}